package main.com.bigcompany.doublelinkedlist;

import java.util.Iterator;

public class Main {

    public static void main(String[] args) {
        DoublyLinkedList<Integer> list = new DoublyLinkedList<Integer>();
        list.add(1);
        list.add(2);
        list.add(3);

        list.addFirst(5);
        list.addLast(6);

        System.out.println(list.contains(3));

        System.out.println("Iterator");
        for (Integer aList : list) {
            System.out.println(aList);
        }

        System.out.println("Reverse iterator");
        Iterator iterator = list.reverseIterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
